﻿using System;
using System.Collections.Generic;

namespace AutoClub.Core.Domain.Dao
{
    public interface IUsersRepo
    {
        #region Methods

        /// <summary>
        /// Gets a single instance by its identifier
        /// </summary>
        /// <param name="id">Entity's di</param>
        /// <returns>The instance for this id</returns>
        User Get(Guid id);

        /// <summary>
        /// Gets all the entities
        /// </summary>
        /// <returns>A list of entities</returns>
        IEnumerable<User> GetAll();

        /// <summary>
        /// Gets all administrators users
        /// </summary>
        /// <returns>A list of entities</returns>
        IEnumerable<User> GetAllAdministrators();

        /// <summary>
        /// Get all the entities that satisfied a given predicate
        /// </summary>
        /// <param name="predicate">a predicate for filter</param>
        /// <returns></returns>
        IEnumerable<User> GetBy(Func<User, bool> predicate);


        /// <summary>
        /// Persists an entity in the database
        /// </summary>
        /// <returns>The persisted entity</returns>
        User Add(string email, string password, CarCategoryEnum category);

        /// <summary>
        /// Updates the current entity
        /// </summary>
        /// <param name="entity">entity to update</param>
        /// <returns></returns>
        User Update(User entity);

        /// <summary>
        /// Removes the current entity of the system.
        /// </summary>
        /// <param name="entity">Entity to be removed</param>
        /// <returns></returns>
        User Remove(User entity);

        /// <summary>
        /// Determines if the current user already exists in the system
        /// </summary>
        /// <param name="email">user email unique identifier</param>
        /// <param name="password">user password</param>
        /// <returns>true if the current user is valid, false otherwise</returns>
        bool IsUserValid(string email, string password);

        #endregion
    }
}
